//
//  HYLTuangouCell.m
//  UITableView增删改
//
//  Created by hyl on 16/6/1.
//  Copyright © 2016年 hyl. All rights reserved.
//

#import "HYLTuangouCell.h"
#import "HYLTuangou.h"

@interface HYLTuangouCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UILabel *titleLable;
@property (weak, nonatomic) IBOutlet UILabel *priceLable;
@property (weak, nonatomic) IBOutlet UILabel *buyCountLable;
@property (weak, nonatomic) IBOutlet UIImageView *checkView;


@end

@implementation HYLTuangouCell

#pragma mark - implementation
+(instancetype) tuangouCellWithTableView:(UITableView *)tableView{
    HYLTuangouCell *cell=[tableView dequeueReusableCellWithIdentifier:@"tuangou"];
    if (cell==nil) {
        cell=[[[NSBundle mainBundle]loadNibNamed:NSStringFromClass([HYLTuangouCell class]) owner:nil options:nil]firstObject];
    }
    return cell;
    
}
#pragma mark - setter/getter
-(void) setTuangou:(HYLTuangou *)tuangou{
    _tuangou=tuangou;
    self.iconView.image=[UIImage imageNamed:tuangou.icon];
    self.titleLable.text=tuangou.title;
    self.priceLable.text=tuangou.price;
    self.buyCountLable.text=tuangou.buyCount;
    self.checkView.hidden=!tuangou.state;
}

@end
